package com.hc.wdj.spring;

import com.hc.wdj.core.context.HcContext;
import com.hc.wdj.core.context.model.HcRequest;
import com.hc.wdj.core.context.model.HcResponse;
import com.hc.wdj.servlet.model.HcRequestForServlet;
import com.hc.wdj.servlet.model.HcResponseForServlet;

/**
 * @author ryanwdj
 * @since 2024/11/14
 */
public class HcContextForSpring implements HcContext {

    public HcRequest getRequest() {
        return new HcRequestForServlet(SpringMVCUtil.getRequest());
    }

    public HcResponse getResponse() {
        return new HcResponseForServlet(SpringMVCUtil.getResponse());
    }

    @Override
    public boolean isValid() {
        return SpringMVCUtil.isWeb();
    }
}
